package cn.fz.securityquickstart.controller;

import cn.fz.securityquickstart.entity.User;
import cn.fz.securityquickstart.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {
    private final UserService userService;

    @GetMapping("/list")
    public List<User> getUserList(){
        return userService.list();
    }

    @PostMapping("/addUser")
    public int addUser(@RequestBody User user) {
        return userService.addUser(user);
    }
}
